<?php
function imgstr($img_url,$img_w,$img_h){
$img=getimagesize($img_url);
$w=$img[0];
$h=$img[1];
$a=($w/$img_w);
$b=($h/$img_h);
if($a>$b){
echo "wedth='";
echo $w*$b;
echo "' height='";
echo $h*$b;
echo "'";
}else{
echo "wedth='";
echo $w*$a;
echo "' height='";
echo $h*$a;
echo "'";
}
}
?>
<img src="images/logo.gif" border="0" <?=imgstr("images/logo.gif","100","80")?> />
<img src="images/logo.gif" border="0" />